package com.zhentao.day02.am;

import java.util.Comparator;

public class StudentComparator implements Comparator<Student> {
  @Override
  public int compare(Student o1, Student o2) {
    if (o1.getAge() == o2.getAge()) {
      return o1.getName().compareTo(o2.getName());
    }

    return o1.getAge()-o2.getAge();
  }
}
